|
|
|
|
|
|
|
Perception is reality. I am referring here to how users' observations can influence their like or dislike of your program. Application speed is a prime example. You may have written the fastest VB code ever, but it matters little if users think it runs slowly. VB programmers tend to get defensive when users complain about speed because "the users don't know what the program is doing." However, you can incorporate a few tricks to make your program seem faster. |
|
|
|
|
|
|
|
|
The key to a program's perceived speed is that something needs to happen when a user clicks an icon. Users are more willing to wait if they think the computer is working as fast as it can. Booting Windows is a good example; it usually takes quite a long time. However, all the graphics, beeps, and hard drive noise keep you distracted enough to make the wait acceptable. The techniques discussed in the following sections give you suggestions for creating "faster" VB applications. |
|
|
|
|
|
|
|
|
At the beginning of your program, you probably will have some initialization to performfor example, opening a network database. The Sub Main subroutine is an excellent place for all the initialization code required at startup time. If your program has only a few forms ( two to five), you can load all of them during Sub Main so that they appear quickly when the application needs to show them. Although loading all these forms slows the application's performance at startup, the application's runtime performance is much faster. The Load method places the forms in memory, but they remain invisible to the users until the Show method is executed. |
|
|
|
|
|
|
|
|
However, this technique may cause program startup time to get a bit lengthy, so displaying a splash screen during load time is a good idea. A splash screen (see Figure 18.9) displays information about the program and its designer, as well as indicates to the users that some action is happening. |
|
|
|
|
|
|
|
|
Figure 18.9
This splash screen gives the users something
to look at while program initialization takes place. |
|
|
|
|
| |
|
|
|
|
If you are updating a label's caption on a splash or status screen, make sure to call DoEvents or the label's Refresh method so that program initialization does not prevent the label from being updated. |
|
|
|
|
|
|
|
|
|
|
Inform the Users of Progress |
|
|
|
|
|
|
|
|
When your application looks like it is doing something, users tend to be more forgiving of long wait times. One way to keep them informed is to use a ProgressBar control on your form. If you are updating records in a database, you can use a |
|
|
|
|
|